package coint.btc.interceptor;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Component
public class WebAppConfig extends WebMvcConfigurerAdapter{
	/**
	 * 添加需要拦截的请求以及排除不需要拦截的请求
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		String[] interceptPatterns = { "/btcWeb/**" };
		String[] excludePatterns = {"/btcWeb/user/login","/btcWeb/user/loginOut" };
		registry.addInterceptor(new SessionInterceptor()).addPathPatterns(interceptPatterns)
				.excludePathPatterns(excludePatterns);
	}
}
